[data] = obs_read('c:\manoj\projects\tsunami\obs_data\CZT.dat','X');
cztdata = reshape(data(:,5:64)',[1,2880]);
[data] = obs_read('c:\manoj\projects\tsunami\obs_data\AMS.dat','Z');
amsdata = reshape(data(:,5:64)',[1,2880]);
[data] = obs_read('c:\manoj\projects\tsunami\obs_data\PAF.dat','X');
pafdata = reshape(data(:,5:64)',[1,2880]);
[data] = obs_read('c:\manoj\projects\tsunami\obs_data\ABG.dat','Z');
abgdata = reshape(data(:,5:64)',[1,2880]);
pnd1= load('c:\manoj\projects\tsunami\balasis\dEC2604.PON');
%hh mm        H        D        Z (format)
pnd0= load('c:\manoj\projects\tsunami\balasis\dEC2504.PON');
tir0= load('c:\manoj\projects\tsunami\balasis\dEC2504.tir');
tir1= load('c:\manoj\projects\tsunami\balasis\dEC2604.tir');
tirdata = [tir0(:,5)' tir1(:,5)'];
pnddata = [pnd0(:,5)' pnd1(:,5)'];

ts_obs_dat = [abgdata;pnddata;tirdata;amsdata;cztdata;pafdata];

L = abs(ts_obs_dat) > 90000;
ts_obs_dat(2,283) = ts_obs_dat(2,284);
a = find(L(3,:) == 1);
ts_obs_dat(3,a) = ts_obs_dat(3,a-1);
ts_obs_dat(3,a) = ts_obs_dat(3,a-1);

for i = 1:6,
    ts_obs_dat(i,:) = cortre(ts_obs_dat(i,:),0);
end;

n1 = datenum(2004,12,25,0,0,30);
n2 = datenum(2004,12,27,0,0,30);
timaxis=n1:2/2880:n2-2/2880;
n3 = datenum(2004,12,26,0,50,00);
L = timaxis > datenum(2004,12,25,10,0,30) & timaxis < datenum(2004,12,26,15,0,30);
% plot(timaxis(L),ts_obs_dat(:,L)+repmat([0 10 20 30 40 50]',[1,sum(L)]));
% legend('abg','pnd','tir','ams','czt','paf');
STN = upper(['abg';'pnd';'tir';'ams';'czt';'paf']);

hold on;
aa = axis;
plot([n3 n3],aa(3:4),'r--');

 datetick('x',14);
 
 waven = 'cgau4';
Sc = scal2frq(1./[1:1:100],waven,1);
 for i = 1:6,
     c = cwt(ts_obs_dat(i,L),Sc,waven);
subplot(6,1,i);
     imagesc(timaxis(L),[1:1:100],abs(c));
     aa = axis;
     hold on;
plot([n3 n3],aa(3:4),'r--');
text(aa(1),(aa(3)+aa(4))/2,STN(i,:));
datetick('x',15);
% axis off;
% if i == 6,
% axis on;
%     
% end;
 end;